package com.carbohydrate42.kotlin_compose_demo.entity

import androidx.room.ColumnInfo
import androidx.room.Entity
import androidx.room.Ignore
import androidx.room.PrimaryKey

/**
 * 参考
 * https://developer.android.google.cn/codelabs/basic-android-kotlin-training-update-data-room?hl=zh-cn#0
 */

@Entity(tableName = "test_user")
data class User(
    @PrimaryKey(autoGenerate = true)
    var id: Long? = 0,
    @ColumnInfo(name = "name")
    var name: String? = null,
    @ColumnInfo(name = "password")
    var password: String? = null,
    @ColumnInfo(name = "auth_token")
    var authToken: String? = null,
) {
    // 不加上, room 会报错
    // There are multiple good constructors and Room will pick the no-arg constructor. You can use the @Ignore annotation to eliminate unwanted constructors
    @Ignore
    constructor() : this(0)
}
